package com.xinsoft.entity.dto;

import cn.hutool.core.util.ObjectUtil;
import com.xinsoft.entity.vo.ErpPurchaseNoticeItemVO;
import com.xinsoft.entity.vo.ErpPurchaseNoticeVO;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 采购收料通知
 * */
@Data
public class KisPurchaseNoticeBodyDto {

    private String   FInterId;       //头主键
    private String   FEntryID;       //行号
    private String   FItemID;       //物料代码
    private String   FUnitID;       //单位
    private String   FQty;       //基本单位数量
    private String   Fauxqty;       //数量
    private String   FNote;       //备注
    private String   FBatchNo;       //批号
    private String   FSourceBillNo;       //源单单号
    private String   FSourceTranType;       //源单类型
    private String   FSourceInterId; //源单内码   暂时作为上游 采购单主键
    private String   FSourceEntryID; //源单分录   暂时作为上游 采购明细主键

    private String   Fauxprice;       //单价
    private String   Famount;       //金额
    private String   FMapNumber;       //对应代码
    private String   FMapName;       //对应名称
    private String   FKFDate;       //生产/采购日期
    private String   FKFPeriod;       //保质期(天)
    private String   FPeriodDate;       //有效期至
    private String   FStockID;       //收料仓库
    private String   FDCSPID;       //仓位
    private String   FAuxPropID;       //辅助属性
    private String   FSecCoefficient;       //换算率
    private String   FSecQty;       //辅助数量
    private String   FContractBillNo;       //合同单号
    private String   FContractInterID;       //合同内码
    private String   FContractEntryID;       //合同分录
    private String   FNAME;       //订单单号
    private String   FOrderInterID;       //订单内码
    private String   FOrderEntryID;       //订单分录
    private String   FPlanMode;       //计划模式
    private String   FMTONo;       //计划跟踪号
    private String   FOrderType;       //订单类型
    private String   FCheckMethod;       //检验方式
    private String   FQCheckQty;       //基本单位检验数量
    private String   FAuxQCheckQty;       //检验数量
    private String   FSecQCheckQty;       //辅助单位检验数量
    private String   FRelateQty;       //检验基本关联数量
    private String   FAuxRelateQty;       //检验关联数量
    private String   FSecRelateQty;       //辅助单位检验关联数量
    private String   FAuxQtyPass;       //合格数量
    private String   FQtyPass;       //基本单位合格数量
    private String   FSecQtyPass;       //辅助单位合格数量
    private String   FConPassQty;       //基本单位让步接收数量
    private String   FAuxConPassQty;       //让步接收数量
    private String   FSecConPassQty;       //辅助单位让步接收数量
    private String   FNotPassQty;       //基本单位不合格数量
    private String   FAuxNotPassQty;       //不合格数量
    private String   FSecNotPassQty;       //辅助单位不合格数量
    private String   FConCommitQty;       //入库基本关联数量
    private String   FAuxConCommitQty;       //入库关联数量
    private String   FBackQty;       //退料基本关联数量
    private String   FAuxBackQty;       //退料关联数量

    private String FClosed; // 关闭状态


    public ErpPurchaseNoticeItemVO voToPo(KisPurchaseNoticeBodyDto item) {
        if (item == null) {
            return null;
        }
        ErpPurchaseNoticeItemVO erpPurchaseNoticeItemVO = new ErpPurchaseNoticeItemVO();
        erpPurchaseNoticeItemVO.setId(ObjectUtil.isEmpty(item.getFEntryID()) ? null : new Integer(item.getFEntryID()));
        erpPurchaseNoticeItemVO.setHeadId(ObjectUtil.isEmpty(item.getFInterId()) ? null : new Integer(item.getFInterId()));
        erpPurchaseNoticeItemVO.setMaterialId(ObjectUtil.isEmpty(item.getFItemID()) ? null : new Integer(item.getFItemID()));
        erpPurchaseNoticeItemVO.setMainUnitId(ObjectUtil.isEmpty(item.getFUnitID()) ? null : new Integer(item.getFUnitID()));
        erpPurchaseNoticeItemVO.setNum(ObjectUtil.isEmpty(item.getFQty()) ? null : new BigDecimal(item.getFQty()));
        erpPurchaseNoticeItemVO.setAuxNum(ObjectUtil.isEmpty(item.getFauxqty()) ? null : new BigDecimal(item.getFauxqty()));
        erpPurchaseNoticeItemVO.setCommitNum(ObjectUtil.isEmpty(item.getFauxqty()) ? null : new BigDecimal(item.getFConCommitQty()));
        erpPurchaseNoticeItemVO.setRemark(item.getFNote());
        erpPurchaseNoticeItemVO.setBatchNo(item.getFBatchNo());
        erpPurchaseNoticeItemVO.setSourceCode(item.getFSourceBillNo());
        erpPurchaseNoticeItemVO.setSourceType(item.getFSourceTranType());
        erpPurchaseNoticeItemVO.setSourceId(item.getFSourceInterId());
        erpPurchaseNoticeItemVO.setSourceItemID(item.getFSourceEntryID());
        return erpPurchaseNoticeItemVO;
    }


//    {
//          \"FBrNo\": \"0\",
//          \"FInterID\": \"2620\",
//          \"FEntryID\": \"1\",
//          \"FItemID\": \"1475\",
//          \"FQty\": \"2100.0000000000\",
//          \"FCommitQty\": \"0.0000000000\",
//          \"FPrice\": \"4.6153000000\",
//          \"FAmount\": \"9692.13\",
//          \"FNote\": \"\",
//          \"FInvoiceQty\": \"0.0000000000\",
//          \"FBCommitQty\": \"0.0000000000\",
//          \"FQCheckQty\": \"2100.0000000000\",
//          \"FAuxQCheckQty\": \"2100.0000000000\",
//          \"FUnitID\": \"1412\",
//          \"FAuxBCommitQty\": \"0.0000000000\",
//          \"FAuxCommitQty\": \"0.0000000000\",
//          \"FAuxInvoiceQty\": \"0.0000000000\",
//          \"FAuxPrice\": \"4.6153000000\",
//          \"FAuxQty\": \"2100.0000000000\",
//          \"FSourceEntryID\": \"3\",
//          \"FQtyPass\": \"2100.0000000000\",
//          \"FAuxQtyPass\": \"2100.0000000000\",
//          \"FMapNumber\": \"\",
//          \"FMapName\": \"\",
//          \"FBatchNo\": \"20200402025-0105\",
//          \"FKFDate\": \"\",
//          \"FKFPeriod\": \"0\",
//          \"FDCSPID\": \"0\",
//          \"FAuxPropID\": \"0\",
//          \"FDCStockID\": \"0\",
//          \"FFetchDate\": \"\",
//          \"FSecCoefficient\": \"0.0000000000\",
//          \"FSecQty\": \"0.0000000000\",
//          \"FSecCommitQty\": \"0.0000000000\",
//          \"FSourceTranType\": \"71\",
//          \"FSourceInterId\": \"5659\",
//          \"FSourceBillNo\": \"PO2019121906\",
//          \"FContractInterID\": \"0\",
//          \"FContractEntryID\": \"0\",
//          \"FContractBillNo\": \"\",
//          \"FOrderInterID\": \"5659\",
//          \"FOrderEntryID\": \"3\",
//          \"FOrderBillNo\": \"PO2019121906\",
//          \"FStockID\": \"0\",
//          \"FPeriodDate\": \"\",
//          \"FNotPassQty\": \"0.0000000000\",
//          \"FNPCommitQty\": \"0.0000000000\",
//          \"FSampleBreakQty\": \"0.0000000000\",
//          \"FConPassQty\": \"0.0000000000\",
//          \"FConCommitQty\": \"2100.0000000000\",
//          \"FAuxNotPassQty\": \"0.0000000000\",
//          \"FAuxNPCommitQty\": \"0.0000000000\",
//          \"FAuxSampleBreakQty\": \"0.0000000000\",
//          \"FAuxConPassQty\": \"0.0000000000\",
//          \"FAuxConCommitQty\": \"2100.0000000000\",
//          \"FAuxRelateQty\": \"2100.0000000000\",
//          \"FRelateQty\": \"2100.0000000000\",
//          \"FBackQty\": \"0.0000000000\",
//          \"FAuxBackQty\": \"0.0000000000\",
//          \"FSecBackQty\": \"0.0000000000\",
//          \"FSecConCommitQty\": \"0.0000000000\",
//          \"FPlanMode\": \"14036\",
//          \"FMTONo\": \"\",
//          \"FOrderType\": \"71\",
//          \"FCheckMethod\": \"351\",
//          \"FSecConPassQty\": \"0.0000000000\",
//          \"FSecQCheckQty\": \"0.0000000000\",
//          \"FSecRelateQty\": \"0.0000000000\",
//          \"FSecQtyPass\": \"0.0000000000\",
//          \"FSecNotPassQty\": \"0.0000000000\",
//          \"FDetailID\": \"4092\",
//          \"FComplexQty\": \"2100SET\",
//          \"FBarCode\": \"\",
//          \"FBTPLCommitQty\": \"0.0000000000\",
//          \"FTPLCommitQty\": \"0.0000000000\",
//          \"FEntrySelfP0361\": \"\"
//    }

}
